function Meter () {
	this.collectAddr = '000000000';
	this.MeterAddr = ' ';
	this.MeterName = ' ';
	this.MeterTypeId = 0;
	this.CT = 1;
	this.UserTypeId = 0;
	this.BoxAddr = ' ';
	this.DA = 1;
	
}
Meter.prototype.getDA = function(val){
	this.DA = val;
}

Meter.prototype.getMeterName = function(val){
	this.MeterName = val;
}


Meter.prototype.getMeterAddr = function(val){
	this.MeterAddr = val;
}

Meter.prototype.getMeterName = function(val){
	this.MeterName = val;
}

Meter.prototype.getUserTypeId = function(val){
	this.UserTypeId = val;
}

Meter.prototype.getMeterTypeId = function(val){
	this.MeterTypeId = val;
}

Meter.prototype.save = function(){
	let that = this;
	that.collectAddr = CommonUtil.getStorage('selCollectAddr');
	let sqlStr = "select * from Meter where MeterAddr = '"+this.MeterAddr+"'";
	DB.selectSQL(sqlStr,function(data){
		if(data.length <= 0){
			let intoSql = 'INSERT INTO Meter VALUES ("'+that.collectAddr;
				intoSql = intoSql +'", "'+that.MeterAddr;
				intoSql = intoSql +'", "'+that.MeterName
				intoSql = intoSql +'","'+that.MeterTypeId;
				intoSql = intoSql +'", '+that.CT;
				intoSql = intoSql +', "'+that.UserTypeId;
				intoSql = intoSql +'", "'+that.BoxAddr;
				intoSql = intoSql +'",'+that.DA;
				intoSql = intoSql +')';
			DB.insertToSQL(intoSql,function(data){
				if(data == 'success'){
					CommonUtil.createElementHTML("UL",that.MeterAddr + '::数据成功保存',"getResult");
				}else if(data == 'fail'){
					CommonUtil.createElementHTML("UL",that.MeterAddr + '::数据保存失败',"getResult");
				}
			});
		}else{
			CommonUtil.createElementHTML("UL",that.MeterAddr + '::已存在',"getResult");
		}
	});
}

